package com.xhga.transaction.common.jdbc;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import static com.xhga.transaction.common.util.XHGAConfig.*;

/**
 * Created by HuaWeiBo on 2019/5/5.
 */
public class JdbcFactory {
    public static Connection getConn() {
        String driver = "com.mysql.jdbc.Driver";
        String url = TRANSACTION_LOG_DB_URL;
        String username = TRANSACTION_LOG_DB_USERNAME;
        String password = TRANSACTION_LOG_DB_PASSWORD;
        Connection conn = null;
        try {
            Class.forName(driver);
            conn = (Connection) DriverManager.getConnection(url, username, password);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return conn;
    }
}
